package ejb;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

@MessageDriven(
	activationConfig = { 
			@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), 
			@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/test")},
	mappedName = "queue/test"
)
public class EjemploMDB implements MessageListener {

    
    //onMessage
    public void onMessage(Message message){
    	
    	TextMessage textMessage = (TextMessage) message;
        try{
        	System.out.println("Recibido Mensaje COLA TEST: "+textMessage.getText());
        }
        catch (JMSException e){
        	e.printStackTrace();
        }  
    }

}
